﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="ManageSubLocations.aspx.cs" Inherits="Administration_ManageSubLocations"
    CodeFileBaseClass="BaseView" ViewName="ManageSubLocations" Title="Crux - Manage Sub Locations" %>

<%@ Register Src="../Controls/Common/WaterMarkedTextBox.ascx" TagName="WaterMarkedTextBox"
    TagPrefix="crux" %>
<%@ Register Src="../Controls/Common/ErrorNotification.ascx" TagName="ErrorNotification"
    TagPrefix="crux" %>
<%@ Register src="../Controls/Common/ManagedEntityName.ascx" tagname="ManagedEntityName" tagprefix="crux" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="scriptManager" runat="server">
    </asp:ScriptManager>
    <!-- 
        CreativeToDo: The Text Boxes On This Page Don't Change Their BackGround Like Login Page 
             when Validations are not satified 
        -->
    <asp:UpdatePanel ID="updUpdate" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlList" runat="server">
                <crux:ManagedEntityName ID="cruxLocationName" runat="server" PreceedingText="Your Are Currently Managing Location: " ShowEntityURL="true"
                 EntityType="Location" />
                <br /> <br />
                <asp:Button ID="btnAddNewSubLocation" runat="server" Text="Add Sub Location" OnClick="btnAddNewSubLocation_Click" />
                <br />
                <br />
                <asp:GridView ID="grdSubLocations" runat="server" OnRowDataBound="grdSubLocations_RowDataBound"
                    AutoGenerateColumns="False">
                    <Columns>
                        <asp:BoundField DataField="SubLocationID" HeaderText="SubLocation ID" ItemStyle-CssClass="GridFirstColumn" />
                        <asp:BoundField DataField="SubLocationName" HeaderText="SubLocation Name" />
                        <asp:BoundField DataField="SubLocationAddress" HeaderText="SubLocation Address" />
                        <asp:BoundField DataField="SubLocationComments" HeaderText="SubLocation Comments" />
                        <asp:TemplateField HeaderText="Actions" ItemStyle-CssClass="ActionButtons">
                            <ItemTemplate>
                                <center>
                                    <asp:ImageButton ID="btnItemEditIcon" runat="server" CausesValidation="false" CommandName="EditItem"
                                        OnCommand="grdSubLocations_RowCommand" CommandArgument='<%#Eval("SubLocationID")%>'
                                        ImageUrl="~/appimages/edit_sublocations.gif" ToolTip="Edit SubLocation Details" />
                                    <asp:ImageButton ID="btnItemDelete" runat="server" CausesValidation="false" CommandName="DeleteItem"
                                        OnCommand="grdSubLocations_RowCommand" CommandArgument='<%#Eval("SubLocationID")%>'
                                        ImageUrl="~/appImages/delete.gif" ToolTip="Delete" />
                                </center>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </asp:Panel>
            <asp:Panel ID="pnlAddEdit" runat="server">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td class="formTxtHeader" colspan="2">
                            Sub Location
                        </td>
                        
                    </tr>
                    <tr>
                        <td class="formLine" colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formGroupGap">
                        </td>
                    </tr>
                    <!-- Sub Location ID -->
                    <tr>
                        <td align="right" valign="middle" class="formLeftColmnWidth">
                            <asp:Label ID="lblSubLocationID" runat="server" Text="Sub Location ID:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <asp:Label ID="lblSubLocationIDValue" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Sub Location Name -->
                    <tr>
                        <td align="right" valign="middle" class="formLeftColmnWidth">
                            <asp:Label ID="lblSubLocationName" runat="server" Text="Sub Location Name:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtSubLocationName" WaterMarkText="Sub Location Name"
                                ValueRequired="true" ErrorText="Sub Location Name is required." Width="180"
                                MaxLength="50" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Sub Location Address -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="lblSubLocationAddress" runat="server" Text="Sub Location Address:"
                                CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtSubLocationAddress" WaterMarkText="Sub Location Address"
                                ValueRequired="false" TextMode="MultiLine" ErrorText="Sub Location Address is required."
                                Width="180" Height="30" MaxLength="200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Sub Location Comments -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="lblSubLocationComments" runat="server" Text="Sub Location Comments:"
                                CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtSubLocationComments" WaterMarkText="Sub Location Comments"
                                ValueRequired="false" MaxLength="10" TextMode="MultiLine" Width="180" Height="30"
                                runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formGroupGap">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td colspan="2" align="left">
                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
                            &nbsp;
                            <asp:Button ID="btnCancel" CausesValidation="false" runat="server" Text="Cancel"
                                OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <crux:ErrorNotification ID="pnlError" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
